package ntd.util;
import java.util.ArrayList;
import java.util.List;

public class UtilCsv {
    public static void main(String[] args) {
    }

    public List<List<String>> CSV(String csvString, String rel, String sep){
        List<List<String>> csvVos = new ArrayList<>();
        final String[] relArr = csvString.split(rel);// 换行符
        if(relArr.length > 1) {
            for (int i = 1; i < relArr.length; i++) {
                final String[] titles = relArr[i].split(sep);
                final List<String> titleList = new ArrayList<>();
                for (int j = 0; j < titles.length; j++) {
                    String title = titles[j];
                    titleList.add(title);
                }
                csvVos.add(titleList);
            }
        }
        return csvVos;
    }
}
